﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="EnvironmentalMonitor.WebApplication.Environmental.PostMachine.Manage" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
    <% = this.ReferencejQueryCss %>
    <% = this.ReferencejQueryJavascript %>
    <style type="text/css">
        html, body
        {
            margin: 0px;
            padding: 0px;
            height: 100%;
            overflow: hidden;
        }
        #dialog_form
        {
            margin: 0;
            padding: 10px 30px;
        }
        .form_title
        {
            font-size: 14px;
            font-weight: bold;
            color: #666;
            padding: 5px 0;
            margin-bottom: 10px;
            border-bottom: 1px solid #ccc;
        }
        .form_item
        {
            margin-bottom: 5px;
        }
        .form_item label
        {
            display: inline-block;
            width: 120px;
        }
        .form_input
        {
            width: 200px;
        }
    </style>
    <script type="text/javascript">
        var url = '<% = this.SaveJsonUrl %>';

        function editModule() {
            var row = $('#list_data_grid').datagrid('getSelected');
            if (row) {
                var data = {};

                data.Guid = row.Guid;
                data.Remark = row.Remark;
                data.PostId = row.PostId;
                data.MachineId = row.MachineId;

                $.ajax({
                    type: 'POST',
                    url: url,
                    data: data,
                    success: function (data, textStatus, jqXHR) {
                        var result = eval('(' + data + ')');
                        if (result.success) {
                            $('#list_data_grid').datagrid('reload');
                        } else {
                            $.messager.show({
                                title: '错误',
                                msg: result.msg
                            });
                        }
                    }
                });
            }
        };
    </script>
</head>
<body>
    <div style="width: 100%; height: 100%">
        <table id="list_data_grid" title="<% = this.Description %>　的设备管理" class="easyui-datagrid"
            style="width: 100%; height: 100%" url="<% = this.ListJsonUrl %>" toolbar="#list_data_grid_toolbar"
            pagination="true" rownumbers="true" fitcolumns="true" singleselect="true" fit="true"
            pagelist="[<% = int.MaxValue %>]">
            <thead>
                <tr>
                    <th field="PostName">
                        岗位名称
                    </th>
                    <th field="RoomName">
                        机房名称
                    </th>
                    <th field="MachineName">
                        设备名称
                    </th>
                    <th field="ValidityText">
                        状态
                    </th>
                </tr>
            </thead>
        </table>
        <div id="list_data_grid_toolbar">
            <a href="#" class="easyui-linkbutton" iconcls="icon-reload" plain="true" onclick="javascript:editModule()">
                变更</a>
        </div>
    </div>
</body>
</html>
